<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width,initial-scale=1">
		<title>寵爺網</title>
		<link rel="stylesheet" type="text/css" href="frame/bootstrap-3.3.7-dist/css/bootstrap.min.css">
	</head>

	<body>
		<form name="myForm" action="" onsubmit="return validateForm()" method="post">
			名字:
			<input type="text" name="fname">
			<input type="submit" value="提交">
		</form>
		<p>请输入0-9的数字</p>
		<input type="text" id="nub">
		<button type="button" id="bt" onclick="yyy()">提交</button>
		<p id="text"></p>

		<button type="button" onclick="jsh()" id="btn">计数</button>
		<p id="nbr">0</p>

		<script type="text/javascript" src="frame/jquery-3.1.1.min.js"></script>
		<script type="text/javascript" src="frame/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
		<script type="text/javascript">
			
			
			
			document.getElementById("nbr").innerHTML = jsh();

			function jsh() {
				var sum = 0;

				function push() { sum += 1 }
				push();
				return sum;

			}

			function validateForm() {
				var x = document.forms["myForm"]["fname"].value;
				if(x == null || x == "") {
					alert("需要输入名字。");
					return false;
				}
			}

			function isn() {
				var text, a;
				a = document.getElementById("nub").value;
				alert(a);
				if(isNaN(a) || min == 1 || a > 30) {
					text = "输入错误";

				} else {
					text = "输入";
				}
				document.getElementById("text").innerHTML = text;
			}

			function Fn() {
				getNum = function() {
					console.log(1)
				};
				return this;
			}
			Fn.getNum = function() {
				console.log(2)
			};
			Fn.prototype.getNum = function() {
				console.log(3)
			};
			var getNum = function() {
				console.log(4)
			};

			function getNum() {
				console.log(5)
			};

			Fn.getNum() //2
			getNum() //4
			Fn().getNum() //1
			new Fn.getNum() //2
			new Fn().getNum() //3
			new new Fn().getNum() //3

			var json = {
				a: 1,
				b: 2,
				c: 3
			}
			var a = "b";
			var b = 'c';
			console.log(json.a)
			console.log(json[b])
			console.log(json[2])
		</script>
	</body>

</html>